package com.jy.rhin.infra.repo.document.validation;

import com.jy.common.UIDWorker;
import com.jy.rhin.domain.document.validation.DocumentValidationFileDao;
import com.jy.rhin.infra.repo.document.validation.mapper.DocumentValidationFileMapper;
import com.jy.rhin.infra.repo.document.validation.po.DocumentValidationFilePo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 *
 */
@Service
public class DocumentValidationDaoImpl implements DocumentValidationFileDao {

    @Resource
    UIDWorker uidWorker;
    @Resource
    private DocumentValidationFileMapper documentValidationFileMapper;


    @Override
    public Long save(DocumentValidationFilePo documentValidationFilePo) {
        long id = uidWorker.nextId();
        documentValidationFileMapper.insert(documentValidationFilePo);
        return id;
    }

    @Override
    public Integer update(DocumentValidationFilePo documentValidationFile) {
        return  documentValidationFileMapper.updateById(documentValidationFile);
    }

}
